package adc.budget.ui.web.wicket.account;

import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.SimpleFormComponentLabel;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.ResourceModel;

import adc.app.ui.wicket.BoEditPanel;
import adc.budget.spec.bo.IAccountType;
import adc.budget.ui.web.wicket.IMsgsMisc;

public class AccountTypeEditPanel extends BoEditPanel<IAccountType> {

    private static final long serialVersionUID = 1L;

    public AccountTypeEditPanel(String id) {
        super(id);
    }

    @Override
    protected void addFields(Form<IAccountType> form) {
        final TextField<String> tfName = new TextField<String>("name");
        final CheckBox cbCredit = new CheckBox("credit");
        
        tfName.setLabel(new ResourceModel(IMsgsMisc.NAME));
        cbCredit.setLabel(new ResourceModel(IMsgsAccount.CREDIT));
        
        form.add(tfName).add(cbCredit);
        form.add(new SimpleFormComponentLabel("nameLbl", tfName));
        form.add(new SimpleFormComponentLabel("creditLbl", cbCredit));
    }
}

